import http from '@/assets/utils/request'

/** *获取祝福语列表 */
/**
 *  pageNum - 页码
    pageSize - 页数
    findContent - 模糊查询
 */
export function getBlessList (data) {
  return http(
    {
      fromwho: 'test',
      url: 'blessings/list',
      method: 'get'
    },
    data
  )
}
/** *添加祝福语 */
/**
    json-
    { id 祝福语id;name 祝福语名称;content 祝福语内容
      ids - 模板id 可传多个，以“,”分隔
    }
 */
export function addBless (data) {
  return http(
    {
      fromwho: 'test',
      url: 'blessings/add',
      method: 'post',
      isloading: true,
      isalert: true
    },
    data
  )
}
/** *编辑祝福语 */
/**
    json-
    {   id - 祝福语id;name 祝福语名称;content 祝福语内容
    }
 */
export function editBless (data) {
  return http(
    {
      fromwho: 'test',
      url: 'blessings/edit',
      method: 'post',
      isloading: true,
      isalert: true
    },
    data
  )
}
/** *获取祝福语明细*/
/**
 *  id - 祝福语id
 */
export function getBlessDetail (data) {
  return http(
    {
      fromwho: 'test',
      url: 'blessings/details',
      method: 'get'
    },
    data
  )
}
/** *删除祝福语*/
/**
 *  id - 祝福语id
 */
export function delBless (data) {
  return http(
    {
      fromwho: 'test',
      url: 'blessings/delete',
      method: 'post',
      isloading: true,
      isalert: true
    },
    data
  )
}
/** *根据模版获取祝福语*/
/**
 *  templateId  -  模版id
 */
export function getBlessByTemplate (data) {
  return http(
    {
      fromwho: 'test',
      url: 'blessings/get',
      method: 'get'
    },
    data
  )
}
/** *绑定祝福语*/
/**
 *  json{
  *  tempid - 模板id;blessingsid 祝福语id
  * }
 */
export function bindBlessWithTemplate (data) {
  return http(
    {
      fromwho: 'test',
      url: 'Bind/bind',
      method: 'post'

    },
    data
  )
}
/** *解绑祝福语*/
/**
 *  ids - 祝福语id，可传多个，以“,”分隔
 */
export function unbindBlessWithTemplate (data) {
  return http(
    {
      fromwho: 'test',
      url: 'Bind/unbind',
      method: 'post',
      isloading: true,
      isalert: true
    },
    data
  )
}
